#ifndef MATERIAL_H_
#define MATERIAL_H_

#include <exception>
#include <obj.hpp>
#include <vector>
#include "image_cache.h"
#include "rgbaColor.h"

class Material{
	private:
		RGBAColor _ambient;
		RGBAColor _specular;
		RGBAColor _diffuse;
		float _shininess;
		float _transparency;
		ImageCache::TexturePtr _texture;
		bool _textured;
		std::string _path;

		Material(const Material&);
		void operator =(const Material&);
	public:
		Material();
		~Material();

		void path(const std::string& path){ _path=path; }
		void ambient(float r,float g,float b){ _ambient=RGBAColor(r,g,b); }
		void specular(float r,float g,float b){ _specular=RGBAColor(r,g,b); }
		void diffuse(float r,float g,float b){ _diffuse=RGBAColor(r,g,b); }
		void shininess(float shininess){ _shininess=shininess; }
		void transparency(float transparency){ _transparency=transparency; }

		void texture(const std::string& name);
		void freeTexture();

		const std::string path(){ return _path; }
		const RGBAColor& ambient()const{ return _ambient; }
		const RGBAColor& specular()const{ return _specular; }
		const RGBAColor& diffuse()const{ return _diffuse; }
		float shininess()const{ return _shininess; }
		float transparency()const{ return _transparency; }
		ImageCache::TexturePtr& texture(){ return _texture; }
		bool textured(){ return _texture; }
};

#endif /* MATERIAL_H_ */
